<?php
/**
 * Created by PhpStorm.
 * User: Frings
 * Date: 2016/9/8
 * Time: 17:55
 */

use yii\helpers\Url;

$web = Url::base();
?>

<script type="application/javascript">
    function calcCount() {
        var startindex = $('#start_index').val();
        var endindex = $('#end_index').val();

        if (isNaN(startindex) || isNaN(endindex)) {
            $('#index_qty').html(0);
            return;
        }
        var r = endindex - startindex + 1;
        if (r < 0) {
            $('#index_qty').val(0);
            return;
        }
        $('#index_qty').val(r);
    }
</script>

<div class="form-horizontal" id="modaledit_submit_form">
    <div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">销售人员：</label>
            <div class="col-lg-10">
                <input type="text" id="saler" name="saler" class="form-control">
            </div>
        </div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">名片名称：</label>
            <div class="col-lg-10">
                <input type="text" id="name" name="name" class="form-control">
            </div>
        </div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">名片描述：</label>
            <div class="col-lg-10">
            <textarea id="description" name="description" class="form-control"
                      rows="3"></textarea>
            </div>
        </div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">单证开始：</label>
            <div class="col-lg-10">
                <input type="number" id="start_index" name="start_index" class="form-control" oninput="calcCount()">
            </div>
        </div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">单证结束：</label>
            <div class="col-lg-10">
                <input type="number" id="end_index" name="end_index" class="form-control" oninput="calcCount()">
            </div>
        </div>
        <div class="form-group" style=" margin-top: 5px">
            <label class="control-label col-lg-2" for="exampleInputPassword2">单证数量：</label>
            <div class="col-lg-10">
                <input type="text" id="index_qty" name="index_qty" class="form-control"
                       disabled="disabled">
            </div>
        </div>
    </div>
</div>
